import { defHttp } from '@/utils/http/axios'

enum Api {
  ALARM_TABLE_DATA = '/alarm/rule/page',
  ADD_ALARM_RECORD = '/alarm/rule/add',
  ALARM_RECORD_UPDATE = '/alarm/rule/update',
  GET_ALARM_TYPE_LIST = '/alarm/type/list',
  GET_ALARM_WAY_LIST = '/alarm/rule/alarmMode',
  ALARM_UPDATE_STATUS = '/alarm/rule/updateStatus',
  ALARM_RECORD_DELETE = '/alarm/rule/delete',
  ALARM_MODEL_PAGE = '/alarm/record/model/page',
}

export const getDataList = (params) => defHttp.get({ url: Api.ALARM_TABLE_DATA, params })
export const alarmRecordAdd = (data) => defHttp.post({ url: Api.ADD_ALARM_RECORD, data })
export const alarmRecordUpdate = (data) => defHttp.post({ url: Api.ALARM_RECORD_UPDATE, data })
export const getAlarmTypeList = () => defHttp.get({ url: Api.GET_ALARM_TYPE_LIST })
export const getAlarmWayList = () => defHttp.get({ url: Api.GET_ALARM_WAY_LIST })
export const updateStatus = (data) => defHttp.post({ url: Api.ALARM_UPDATE_STATUS, data })
export const deleteTableData = (data) => defHttp.post({ url: Api.ALARM_RECORD_DELETE, data })
export const getAlarmRecordModel = (params) => defHttp.get({ url: Api.ALARM_MODEL_PAGE, params })
